package MyOop04;

import java.util.Scanner;

/**
 * 游戏骂人敏感词替换
 */
public class StringDemo009 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请开始讲话：");
        String talk = scanner.next();
        //定义一个敏感词数组
        String[] arr = {"TMD","CNM","WDNMD","爸爸","政治"};

        for (int i = 0; i < arr.length; i++) {
            talk =talk.replace(arr[i],"***");
        }
        System.out.println(talk);
    }
}
